package com.zhanglingfei.yuekaoshop.entity;

import lombok.Data;

import java.io.Serializable;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author Shichao.Lu
 * 库存表，代表库存，秒杀库存等信息
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "tb_stock")
@DynamicInsert
@DynamicUpdate
public class Stock implements Serializable {

	/**
	 * 库存对应的商品sku id
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "sku_id")
	private Long skuId;

	/**
	 * 可秒杀库存
	 */
	@Column(name = "seckill_stock")
	private Integer seckillStock;

	/**
	 * 秒杀总数量
	 */
	@Column(name = "seckill_total")
	private Integer seckillTotal;

	/**
	 * 库存数量
	 */
	@Column(name = "stock")
	private Integer stock;
}
